/* PacketParser - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */

public class PacketParser {
	public byte[] aByteArray1038;
	public int anInt1039;
	public byte[] aByteArray1040 = new byte[256];
	public static JString aClass3_1041 = (Class39_Sub5_Sub9.createJString(125, "No matching objects found)1 please shorten search"));
	public byte[] aByteArray1042;
	public int anInt1043;
	public int[] anIntArray1044;
	public int anInt1045;
	public byte[][] aByteArrayArray1046 = new byte[6][258];
	public int anInt1047;
	public boolean[] aBooleanArray1048 = new boolean[16];
	public static JString aClass3_1049;
	public static JString aClass3_1050;
	public static int publicChatOptions;
	public int anInt1052;
	public int anInt1053;
	public static int mouseY;
	public int[] anIntArray1055;
	public static JString aClass3_1056;
	public byte[] aByteArray1057;
	public static JString aClass3_1058 = Class39_Sub5_Sub9.createJString(106, "Trade)4compete");
	public byte[] aByteArray1059;
	public int anInt1060;
	public int anInt1061;
	public byte[] aByteArray1062;
	public static long aLong1063;
	public boolean[] aBooleanArray1064;
	public int[] anIntArray1065;
	public int anInt1066;
	public int[][] anIntArrayArray1067;
	public int anInt1068;
	public int[][] anIntArrayArray1069;
	public int[][] anIntArrayArray1070;
	public int anInt1071;
	public static Class9 aClass9_1072;
	public int anInt1073;
	public static JString aClass3_1074;
	public int[] anIntArray1075;
	public int anInt1076;
	public int anInt1077;
	public static int anInt1078;
	public int anInt1079;
	public byte aByte1080;

	public static void method1031(int i) {
		aClass3_1056 = null;
		aClass3_1058 = null;
		aClass3_1049 = null;
		aClass3_1074 = null;
		aClass9_1072 = null;
		aClass3_1050 = null;
		aClass3_1041 = null;
	}

	public static void method1032(Class9 class9, byte i, Class9 class9_0_, TextRenderer class39_sub5_sub10_sub1, boolean bool) {
		Class47.aBoolean894 = bool;
		Class4.aClass9_71 = class9;
		Class31.aClass9_568 = class9_0_;
		Class37.anInt663 = Class31.aClass9_568.method158(10, (byte) -4);
		PacketStream.aClass39_Sub5_Sub10_Sub1_2148 = class39_sub5_sub10_sub1;
	}

	public static void method1033(int i, int i_1_, boolean bool, int i_2_) {
		for (int i_3_ = 0; i_3_ < 8; i_3_++) {
			for (int i_4_ = 0; i_4_ < 8; i_4_++)
				Class67.anIntArrayArrayArray1175[i][i_3_ + i_2_][i_1_ + i_4_] = 0;
		}
		if (i_2_ > 0) {
			for (int i_5_ = 1; i_5_ < 8; i_5_++)
				Class67.anIntArrayArrayArray1175[i][i_2_][i_1_ + i_5_] = (Class67.anIntArrayArrayArray1175[i][i_2_ - 1][i_1_ + i_5_]);
		}
		if (i_1_ > 0) {
			for (int i_6_ = 1; i_6_ < 8; i_6_++)
				Class67.anIntArrayArrayArray1175[i][i_6_ + i_2_][i_1_] = (Class67.anIntArrayArrayArray1175[i][i_2_ + i_6_][i_1_ - 1]);
		}
		if (i_2_ > 0 && Class67.anIntArrayArrayArray1175[i][i_2_ - 1][i_1_] != 0)
			Class67.anIntArrayArrayArray1175[i][i_2_][i_1_] = Class67.anIntArrayArrayArray1175[i][i_2_ - 1][i_1_];
		else if (i_1_ <= 0 || Class67.anIntArrayArrayArray1175[i][i_2_][i_1_ - 1] == 0) {
			if (i_2_ > 0 && i_1_ > 0 && (Class67.anIntArrayArrayArray1175[i][i_2_ - 1][i_1_ - 1] != 0))
				Class67.anIntArrayArrayArray1175[i][i_2_][i_1_] = Class67.anIntArrayArrayArray1175[i][i_2_ - 1][i_1_ - 1];
		} else
			Class67.anIntArrayArrayArray1175[i][i_2_][i_1_] = Class67.anIntArrayArrayArray1175[i][i_2_][i_1_ - 1];
	}

	public static void method1034(Class39_Sub5_Sub10_Sub4 class39_sub5_sub10_sub4, byte i) {
		int i_7_ = 256;
		for (int i_8_ = 0; i_8_ < Class7.anIntArray112.length; i_8_++)
			Class7.anIntArray112[i_8_] = 0;
		for (int i_9_ = 0; i_9_ < 5000; i_9_++) {
			int i_10_ = (int) ((double) i_7_ * (Math.random() * 128.0));
			Class7.anIntArray112[i_10_] = (int) (Math.random() * 256.0);
		}
		for (int i_11_ = 0; i_11_ < 20; i_11_++) {
			for (int i_12_ = 1; i_12_ < i_7_ - 1; i_12_++) {
				for (int i_13_ = 1; i_13_ < 127; i_13_++) {
					int i_14_ = i_13_ + (i_12_ << 7);
					Class19.anIntArray377[i_14_] = (Class7.anIntArray112[i_14_ - 128] + Class7.anIntArray112[i_14_ - 1] + Class7.anIntArray112[i_14_ + 1] + Class7.anIntArray112[i_14_ + 128]) / 4;
				}
			}
			int[] is = Class7.anIntArray112;
			Class7.anIntArray112 = Class19.anIntArray377;
			Class19.anIntArray377 = is;
		}
		if (class39_sub5_sub10_sub4 != null) {
			int i_15_ = 0;
			for (int i_16_ = 0; i_16_ < class39_sub5_sub10_sub4.anInt2481; i_16_++) {
				for (int i_17_ = 0; class39_sub5_sub10_sub4.anInt2480 > i_17_; i_17_++) {
					if (class39_sub5_sub10_sub4.aByteArray2486[i_15_++] != 0) {
						int i_18_ = i_17_ + 16 + class39_sub5_sub10_sub4.anInt2484;
						int i_19_ = class39_sub5_sub10_sub4.anInt2479 + (i_16_ + 16);
						int i_20_ = (i_19_ << 7) + i_18_;
						Class7.anIntArray112[i_20_] = 0;
					}
				}
			}
		}
	}

	public static void method1035(byte i, int i_21_, int i_22_) {
		PacketStream.outputStream.writePacket(153);
		PacketStream.outputStream.writeShortLE(i_21_);
		PacketStream.outputStream.writeInt(i_22_);
	}

	public static Class39_Sub5_Sub10_Sub4 method1036(boolean bool) {
		Class39_Sub5_Sub10_Sub4 class39_sub5_sub10_sub4 = new Class39_Sub5_Sub10_Sub4();
		class39_sub5_sub10_sub4.anIntArray2485 = Class39_Sub11.anIntArray1460;
		class39_sub5_sub10_sub4.anInt2483 = Class39_Sub5_Sub12.anInt1854;
		class39_sub5_sub10_sub4.aByteArray2486 = CollisionMap.aByteArrayArray517[0];
		class39_sub5_sub10_sub4.anInt2479 = Class39_Sub5.anIntArray1352[0];
		class39_sub5_sub10_sub4.anInt2480 = Class39_Sub5_Sub9.anIntArray1799[0];
		class39_sub5_sub10_sub4.anInt2482 = Class13.anInt203;
		class39_sub5_sub10_sub4.anInt2481 = Class39_Sub14.anIntArray1512[0];
		class39_sub5_sub10_sub4.anInt2484 = Class46_Sub1.anIntArray1548[0];
		RuntimeException_Sub1.method1123(false);
		return class39_sub5_sub10_sub4;
	}

	public PacketParser() {
		aByteArray1038 = new byte[4096];
		anIntArray1044 = new int[256];
		anIntArray1065 = new int[257];
		aBooleanArray1064 = new boolean[256];
		aByteArray1059 = new byte[18002];
		anIntArrayArray1069 = new int[6][258];
		anIntArrayArray1067 = new int[6][258];
		anIntArrayArray1070 = new int[6][258];
		anIntArray1075 = new int[6];
		anInt1077 = 0;
		anInt1076 = 0;
		anIntArray1055 = new int[16];
		aByteArray1042 = new byte[18002];
	}

	public static boolean parsePacket(byte i) {
		if (Class37.activeSocket == null)
			return false;
		try {
			int available = Class37.activeSocket.available();
			if (available == 0)
				return false;
			if (Class4.packetID == -1) {
				available--;
				Class37.activeSocket.read(1, (Class39_Sub5_Sub11.inputStream.buffer), 0);
				Class39_Sub5_Sub11.inputStream.currentOffset = 0;
				Class4.packetID = Class39_Sub5_Sub11.inputStream.readPacket();
				Class40.packetSize = client.packetSizes[Class4.packetID];
			}
			if (Class40.packetSize == -1) {
				if (available > 0) {
					available--;
					Class37.activeSocket.read(1, (Class39_Sub5_Sub11.inputStream.buffer), 0);
					Class40.packetSize = (Class39_Sub5_Sub11.inputStream.buffer[0]) & 0xff;
				} else
					return false;
			}
			if (Class40.packetSize == -2) {
				if (available <= 1)
					return false;
				Class37.activeSocket.read(2, (Class39_Sub5_Sub11.inputStream.buffer), 0);
				available -= 2;
				Class39_Sub5_Sub11.inputStream.currentOffset = 0;
				Class40.packetSize = Class39_Sub5_Sub11.inputStream.readShort(-70);
			}
			if (available < Class40.packetSize)
				return false;
			Class39_Sub5_Sub11.inputStream.currentOffset = 0;
			Class37.activeSocket.read(Class40.packetSize, (Class39_Sub5_Sub11.inputStream.buffer), 0);
			Class24.anInt448 = CacheArchive.anInt1283;
			CacheArchive.anInt1283 = Class63.anInt1117;
			Class39_Sub5_Sub11.anInt1827 = 0;
			Class63.anInt1117 = Class4.packetID;
			if (Class4.packetID == 205) {
				int i_24_ = Class39_Sub5_Sub11.inputStream.readShortLE(10670);
				if (i_24_ == 65535)
					i_24_ = -1;
				Class45.method916(i_24_, 118);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 155) {
				int i_25_ = Class39_Sub5_Sub11.inputStream.read3Bytes1((byte) -21);
				int i_26_ = Class39_Sub5_Sub11.inputStream.readShortA(-1);
				if (i_26_ == 65535)
					i_26_ = -1;
				Class37.method351(1, i_25_, i_26_);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 156) {
				int i_27_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				int i_28_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				int i_29_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				int i_30_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class44.aBooleanArray837[i_27_] = true;
				Class13.anIntArray197[i_27_] = i_28_;
				Class2.anIntArray49[i_27_] = i_29_;
				Class45.anIntArray857[i_27_] = i_30_;
				Class4.anIntArray75[i_27_] = 0;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 148) {
				Class39_Sub5_Sub2.anInt1703 = Class39_Sub5_Sub11.inputStream.readByteC((byte) 9);
				Class4.packetID = -1;
				if (Class39_Sub5_Sub2.anInt1703 == Node.anInt728) {
					if (Class39_Sub5_Sub2.anInt1703 == 3)
						Node.anInt728 = 1;
					else
						Node.anInt728 = 3;
					Class39_Sub14.aBoolean1520 = true;
				}
				return true;
			}
			if (Class4.packetID == 192) {
				JString class3 = Class39_Sub5_Sub11.inputStream.readString();
				Object[] objects = new Object[class3.length() + 1];
				for (int i_31_ = class3.length() - 1; i_31_ >= 0; i_31_--) {
					if (class3.charAt(i_31_) != 115)
						objects[i_31_ + 1] = new Integer(Class39_Sub5_Sub11.inputStream.readInt());
					else
						objects[i_31_ + 1] = Class39_Sub5_Sub11.inputStream.readString();
				}
				objects[0] = new Integer(Class39_Sub5_Sub11.inputStream.readInt());
				GameCharacter.method514(0, objects, null, 115, 0, null, 0);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 111) {
				CollisionMap.aBoolean504 = true;
				Class39_Sub5_Sub4_Sub3.anInt2238 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class26.anInt478 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class45.anInt869 = Class39_Sub5_Sub11.inputStream.readShort(104);
				Class46_Sub1.anInt1568 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class43.anInt807 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				if (Class43.anInt807 >= 100) {
					Class39_Sub11.anInt1470 = Class39_Sub5_Sub4_Sub3.anInt2238 * 128 + 64;
					Node.anInt742 = Class26.anInt478 * 128 + 64;
					Class39_Sub10.anInt1437 = (Class14.method212(Node.anInt742, 9990, Class11.currentPlane, Class39_Sub11.anInt1470) - Class45.anInt869);
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 41) {
				ISAAC.method1044(7641);
				Class4.packetID = -1;
				return false;
			}
			if (Class4.packetID == 137) {
				int i_32_ = Class39_Sub5_Sub11.inputStream.readInt();
				int i_33_ = Class39_Sub5_Sub11.inputStream.readInt();
				int i_34_ = Class39_Sub5_Sub11.inputStream.readShort(-67);
				if (i_34_ == 65535)
					i_34_ = -1;
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 19, i_33_);
				if (!class39_sub5_sub17.aBoolean2013) {
					if (i_34_ == -1) {
						Class4.packetID = -1;
						class39_sub5_sub17.anInt2009 = 0;
						return true;
					}
					Class39_Sub5_Sub1 class39_sub5_sub1 = Class26.method291(-78, i_34_);
					class39_sub5_sub17.anInt2009 = 4;
					class39_sub5_sub17.anInt2098 = class39_sub5_sub1.anInt1669;
					class39_sub5_sub17.anInt2074 = class39_sub5_sub1.anInt1649 * 100 / i_32_;
					class39_sub5_sub17.anInt2026 = i_34_;
					class39_sub5_sub17.anInt2011 = class39_sub5_sub1.anInt1676;
				} else {
					class39_sub5_sub17.anInt1997 = i_34_;
					class39_sub5_sub17.anInt2096 = i_32_;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 3) {
				int i_35_ = Class39_Sub5_Sub11.inputStream.readInt1();
				int i_36_ = Class39_Sub5_Sub11.inputStream.readShortLE(10670);
				int i_37_ = i_36_ >> 10 & 0x1f;
				int i_38_ = i_36_ >> 5 & 0x1f;
				int i_39_ = i_36_ & 0x1f;
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 124, i_35_);
				class39_sub5_sub17.anInt2077 = (i_38_ << 11) + (i_37_ << 19) + (i_39_ << 3);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 204) {
				Class31.method322(Class39_Sub5_Sub9.aClass21_1802, Class40.packetSize, Class39_Sub5_Sub11.inputStream, -125);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 77) {
				long l = Class39_Sub5_Sub11.inputStream.readLong();
				JString class3 = Class63.method1090(32767, Class39_Sub5_Sub11.inputStream).formatCapitalization(true);
				Class42.pushMessage(Deque.longToString(l, (byte) 125).capitalizeAfterQuestion((byte) -96), class3, false, 6);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 58) {
				Class39_Sub14.aBoolean1520 = true;
				int i_40_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				int i_41_ = Class39_Sub5_Sub11.inputStream.readByteA((byte) 115);
				int i_42_ = Class39_Sub5_Sub11.inputStream.readInt2();
				Class39_Sub14.anIntArray1543[i_40_] = i_42_;
				Class31.anIntArray555[i_40_] = i_41_;
				Class39_Sub12.anIntArray1491[i_40_] = 1;
				for (int i_43_ = 0; i_43_ < 98; i_43_++) {
					if (i_42_ >= Class53.anIntArray952[i_43_])
						Class39_Sub12.anIntArray1491[i_40_] = i_43_ + 2;
				}
				client.anInt1269 = Class2.anInt48;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 147) {
				int i_44_ = Class39_Sub5_Sub11.inputStream.readInt1();
				int i_45_ = Class39_Sub5_Sub11.inputStream.readShortLE(10670);
				int i_46_ = Class39_Sub5_Sub11.inputStream.readShort(122);
				int i_47_ = Class39_Sub5_Sub11.inputStream.readShortLEA((byte) 123);
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 85, i_44_);
				class39_sub5_sub17.anInt2011 = i_46_;
				class39_sub5_sub17.anInt2074 = i_45_;
				class39_sub5_sub17.anInt2098 = i_47_;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 159) {
				Class15.anInt282 = Class40.packetSize / 8;
				for (int i_48_ = 0; Class15.anInt282 > i_48_; i_48_++)
					Class39_Sub5_Sub9.aLongArray1808[i_48_] = Class39_Sub5_Sub11.inputStream.readLong();
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 74) {
				int i_49_ = Class39_Sub5_Sub11.inputStream.readInt2();
				int i_50_ = Class39_Sub5_Sub11.inputStream.readShort(-75);
				Class39_Sub5_Sub4_Sub2.anIntArray2225[i_50_] = i_49_;
				if (i_49_ != Class66.anIntArray1152[i_50_]) {
					Class66.anIntArray1152[i_50_] = i_49_;
					Node.method408(i_50_, 1);
					if (ISAAC.anInt1095 != -1)
						Class14.aBoolean245 = true;
					Class39_Sub14.aBoolean1520 = true;
				}
				Class4.packetID = -1;
				Class66.anInt1153 = Class2.anInt48;
				return true;
			}
			if (Class4.packetID == 29) {
				Class2.updatePlayers((byte) -109);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 221) {
				int i_51_ = Class39_Sub5_Sub11.inputStream.readShort(111);
				int i_52_ = Class39_Sub5_Sub11.inputStream.readShortLEA((byte) 120);
				Class39_Sub5_Sub8.method594(-107, i_51_);
				if (i_52_ != -1)
					Class39_Sub5_Sub8.method594(-95, i_52_);
				if (Class39_Sub11.openInterface != -1) {
					Class62_Sub2.method1084((byte) 105, Class39_Sub11.openInterface);
					Class39_Sub11.openInterface = -1;
				}
				if (Class39_Sub5_Sub4_Sub5.openSidebarInterface != -1) {
					Class62_Sub2.method1084((byte) -35, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
					Class39_Sub5_Sub4_Sub5.openSidebarInterface = -1;
				}
				if (Tile.anInt1912 != -1) {
					Class62_Sub2.method1084((byte) -127, Tile.anInt1912);
					Tile.anInt1912 = -1;
				}
				if (Class39_Sub5.anInt1348 != i_51_) {
					Class62_Sub2.method1084((byte) -69, Class39_Sub5.anInt1348);
					Class39_Sub5.anInt1348 = i_51_;
					Class39_Sub14.method879((byte) 40, 35);
				} else
					Node.method410(Class39_Sub5.anInt1348, true);
				if (i_51_ != Class39_Sub5_Sub2.anInt1713) {
					Class62_Sub2.method1084((byte) 125, Class39_Sub5_Sub2.anInt1713);
					Class39_Sub5_Sub2.anInt1713 = i_52_;
				} else
					Node.method410(Class39_Sub5_Sub2.anInt1713, true);
				GameCharacter.anInt2285 = 0;
				Class39_Sub10.anInt1420 = -1;
				Class39_Sub4.method457(84, Class39_Sub5.anInt1348);
				Class39_Sub4.method457(101, Class39_Sub5_Sub2.anInt1713);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 228) {
				Class39_Sub14.aBoolean1520 = true;
				int i_53_ = Class39_Sub5_Sub11.inputStream.readInt();
				int i_54_ = Class39_Sub5_Sub11.inputStream.readShort(2);
				RSInterface class39_sub5_sub17;
				if (i_53_ >= 0)
					class39_sub5_sub17 = Class37.getInterface((byte) 91, i_53_);
				else
					class39_sub5_sub17 = null;
				if (class39_sub5_sub17 != null) {
					for (int i_55_ = 0; i_55_ < class39_sub5_sub17.anIntArray2087.length; i_55_++) {
						class39_sub5_sub17.anIntArray2087[i_55_] = 0;
						class39_sub5_sub17.anIntArray2073[i_55_] = 0;
					}
				}
				Class39_Sub9.method863(i_54_, 92);
				int i_56_ = Class39_Sub5_Sub11.inputStream.readShort(94);
				for (int i_57_ = 0; i_56_ > i_57_; i_57_++) {
					int i_58_ = Class39_Sub5_Sub11.inputStream.readByteC((byte) 107);
					if (i_58_ == 255)
						i_58_ = Class39_Sub5_Sub11.inputStream.readInt();
					int i_59_ = Class39_Sub5_Sub11.inputStream.readShort(-116);
					if (class39_sub5_sub17 != null && class39_sub5_sub17.anIntArray2087.length > i_57_) {
						class39_sub5_sub17.anIntArray2087[i_57_] = i_59_;
						class39_sub5_sub17.anIntArray2073[i_57_] = i_58_;
					}
					Class40.method889(i_57_, i_54_, i_59_ - 1, 28, i_58_);
				}
				Class4.packetID = -1;
				Stream.anInt1364 = Class2.anInt48;
				return true;
			}
			if (Class4.packetID == 57) {
				Class14.anInt232 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class4.packetID = -1;
				Class39_Sub14.aBoolean1520 = true;
				return true;
			}
			if (Class4.packetID == 109 || Class4.packetID == 79 || Class4.packetID == 129 || Class4.packetID == 94 || Class4.packetID == 115 || Class4.packetID == 101 || Class4.packetID == 84 || Class4.packetID == 207 || Class4.packetID == 170 || Class4.packetID == 69 || Class4.packetID == 122) {
				Class12.method185(2834);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 146) {
				int i_60_ = Class39_Sub5_Sub11.inputStream.readShortLEA((byte) 120);
				int i_61_ = Class39_Sub5_Sub11.inputStream.readShort(-63);
				if (Tile.anInt1912 != -1) {
					Class62_Sub2.method1084((byte) 109, Tile.anInt1912);
					Tile.anInt1912 = -1;
					Class14.aBoolean245 = true;
				}
				if (Class39_Sub5.anInt1348 != -1) {
					Class62_Sub2.method1084((byte) 113, Class39_Sub5.anInt1348);
					Class39_Sub5.anInt1348 = -1;
					Class39_Sub14.method879((byte) 40, 30);
				}
				if (Class39_Sub5_Sub2.anInt1713 != -1) {
					Class62_Sub2.method1084((byte) 119, Class39_Sub5_Sub2.anInt1713);
					Class39_Sub5_Sub2.anInt1713 = -1;
				}
				if (i_60_ != Class39_Sub11.openInterface) {
					Class62_Sub2.method1084((byte) 107, Class39_Sub11.openInterface);
					Class39_Sub11.openInterface = i_60_;
				} else
					Node.method410(Class39_Sub11.openInterface, true);
				if (i_61_ == Class39_Sub5_Sub4_Sub5.openSidebarInterface)
					Node.method410(Class39_Sub5_Sub4_Sub5.openSidebarInterface, true);
				else {
					Class62_Sub2.method1084((byte) 108, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
					Class39_Sub5_Sub4_Sub5.openSidebarInterface = i_61_;
				}
				ISAAC.aBoolean1089 = true;
				Class39_Sub14.aBoolean1520 = true;
				Class39_Sub10.anInt1420 = -1;
				if (GameCharacter.anInt2285 != 0) {
					GameCharacter.anInt2285 = 0;
					Class14.aBoolean245 = true;
				}
				Class39_Sub4.method457(59, Class39_Sub11.openInterface);
				Class39_Sub4.method457(106, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 154) {
				int i_62_ = Class39_Sub5_Sub11.inputStream.readIntLE();
				Player.aClass56_2529 = Class39_Sub5_Sub9.aClass21_1802.method256(i_62_, 0);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 179) {
				long l = Class39_Sub5_Sub11.inputStream.readLong();
				int i_63_ = Class39_Sub5_Sub11.inputStream.readShort(-113);
				JString class3 = Deque.longToString(l, (byte) 110).capitalizeAfterQuestion((byte) -43);
				for (int i_64_ = 0; i_64_ < Class4.anInt62; i_64_++) {
					if (Applet_Sub1.aLongArray2[i_64_] == l) {
						if (Player.anIntArray2533[i_64_] != i_63_) {
							Player.anIntArray2533[i_64_] = i_63_;
							Class39_Sub14.aBoolean1520 = true;
							if (i_63_ > 0)
								Class42.pushMessage(Class66.aClass3_1164, (Class39_Sub5_Sub11.method708((new JString[] { class3, (Class39_Sub5_Sub6.aClass3_1769) }), 14569)), false, 5);
							if (i_63_ == 0)
								Class42.pushMessage(Class66.aClass3_1164, (Class39_Sub5_Sub11.method708((new JString[] { class3, Class24.aClass3_442 }), 14569)), false, 5);
						}
						class3 = null;
						break;
					}
				}
				boolean bool = false;
				if (class3 != null && Class4.anInt62 < 200) {
					Applet_Sub1.aLongArray2[Class4.anInt62] = l;
					Class39_Sub5_Sub4_Sub1.aClass3Array2188[Class4.anInt62] = class3;
					Player.anIntArray2533[Class4.anInt62] = i_63_;
					Class39_Sub14.aBoolean1520 = true;
					Class4.anInt62++;
				}
				while (!bool) {
					bool = true;
					for (int i_65_ = 0; Class4.anInt62 - 1 > i_65_; i_65_++) {
						if (((Player.anIntArray2533[i_65_] != Class18.anInt344) && (Player.anIntArray2533[i_65_ + 1]) == Class18.anInt344) || ((Player.anIntArray2533[i_65_]) == 0 && (Player.anIntArray2533[i_65_ + 1]) != 0)) {
							bool = false;
							int i_66_ = (Player.anIntArray2533[i_65_]);
							Player.anIntArray2533[i_65_] = (Player.anIntArray2533[i_65_ + 1]);
							Player.anIntArray2533[(i_65_ + 1)] = i_66_;
							JString class3_67_ = (Class39_Sub5_Sub4_Sub1.aClass3Array2188[i_65_]);
							Class39_Sub5_Sub4_Sub1.aClass3Array2188[i_65_] = (Class39_Sub5_Sub4_Sub1.aClass3Array2188[i_65_ + 1]);
							Class39_Sub5_Sub4_Sub1.aClass3Array2188[i_65_ + 1] = class3_67_;
							long l_68_ = Applet_Sub1.aLongArray2[i_65_];
							Applet_Sub1.aLongArray2[i_65_] = Applet_Sub1.aLongArray2[i_65_ + 1];
							Applet_Sub1.aLongArray2[i_65_ + 1] = l_68_;
							Class39_Sub14.aBoolean1520 = true;
						}
					}
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 87) {
				Class39_Sub5_Sub7.anInt1776 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 72) {
				if (Node.anInt728 == 12)
					Class39_Sub14.aBoolean1520 = true;
				Class46_Sub1.anInt1562 = Class39_Sub5_Sub11.inputStream.readSignedShort();
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 140) {
				int i_69_ = Class39_Sub5_Sub11.inputStream.readShortA(-1);
				Class63.method1086((byte) -73, i_69_);
				Class4.packetID = -1;
				Stream.anInt1364 = Class2.anInt48;
				return true;
			}
			if (Class4.packetID == 104) {
				for (int i_70_ = 0; (Class14.aClass39_Sub5_Sub4_Sub4_Sub2Array211.length > i_70_); i_70_++) {
					if (Class14.aClass39_Sub5_Sub4_Sub4_Sub2Array211[i_70_] != null)
						Class14.aClass39_Sub5_Sub4_Sub4_Sub2Array211[i_70_].anInt2268 = -1;
				}
				for (int i_71_ = 0; i_71_ < (Class39_Sub5_Sub4_Sub3.aClass39_Sub5_Sub4_Sub4_Sub1Array2241).length; i_71_++) {
					if ((Class39_Sub5_Sub4_Sub3.aClass39_Sub5_Sub4_Sub4_Sub1Array2241[i_71_]) != null)
						Class39_Sub5_Sub4_Sub3.aClass39_Sub5_Sub4_Sub4_Sub1Array2241[i_71_].anInt2268 = -1;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 73) {
				int i_72_ = Class39_Sub5_Sub11.inputStream.readInt1();
				int i_73_ = Class39_Sub5_Sub11.inputStream.readShortLEA((byte) 120);
				int i_74_ = Class39_Sub5_Sub11.inputStream.readShort(-114);
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 111, i_72_);
				class39_sub5_sub17.anInt2069 = i_73_ + (i_74_ << 16);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 88) {
				int i_75_ = Class39_Sub5_Sub11.inputStream.readInt1();
				int i_76_ = Class39_Sub5_Sub11.inputStream.readShortA(-1);
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 60, i_75_);
				if (class39_sub5_sub17 != null && class39_sub5_sub17.drawType == 0) {
					if (i_76_ < 0)
						i_76_ = 0;
					if (i_76_ > (class39_sub5_sub17.anInt2095 - class39_sub5_sub17.anInt2015))
						i_76_ = (class39_sub5_sub17.anInt2095 - class39_sub5_sub17.anInt2015);
					class39_sub5_sub17.anInt1994 = i_76_;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 219) {
				int i_77_ = Class39_Sub5_Sub11.inputStream.readSignedShort(true);
				if (i_77_ >= 0)
					Class39_Sub5_Sub8.method594(-125, i_77_);
				if (i_77_ != Class26.anInt485) {
					Class62_Sub2.method1084((byte) 115, Class26.anInt485);
					Class26.anInt485 = i_77_;
				}
				Class39_Sub4.method457(94, Class26.anInt485);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 149) {
				int i_78_ = Class39_Sub5_Sub11.inputStream.readShortA(-1);
				Class39_Sub5_Sub8.method594(-98, i_78_);
				if (Tile.anInt1912 != -1) {
					Class62_Sub2.method1084((byte) 115, Tile.anInt1912);
					Tile.anInt1912 = -1;
					Class14.aBoolean245 = true;
				}
				if (Class39_Sub5.anInt1348 != -1) {
					Class62_Sub2.method1084((byte) 127, Class39_Sub5.anInt1348);
					Class39_Sub5.anInt1348 = -1;
					Class39_Sub14.method879((byte) 40, 30);
				}
				if (Class39_Sub5_Sub2.anInt1713 != -1) {
					Class62_Sub2.method1084((byte) 112, Class39_Sub5_Sub2.anInt1713);
					Class39_Sub5_Sub2.anInt1713 = -1;
				}
				if (Class39_Sub11.openInterface != -1) {
					Class62_Sub2.method1084((byte) 117, Class39_Sub11.openInterface);
					Class39_Sub11.openInterface = -1;
				}
				if (Class39_Sub5_Sub4_Sub5.openSidebarInterface != i_78_) {
					Class62_Sub2.method1084((byte) -62, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
					Class39_Sub5_Sub4_Sub5.openSidebarInterface = i_78_;
				} else
					Node.method410(Class39_Sub5_Sub4_Sub5.openSidebarInterface, true);
				Class39_Sub14.aBoolean1520 = true;
				ISAAC.aBoolean1089 = true;
				Class39_Sub10.anInt1420 = -1;
				if (GameCharacter.anInt2285 != 0) {
					Class14.aBoolean245 = true;
					GameCharacter.anInt2285 = 0;
				}
				Class39_Sub4.method457(104, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 160) {
				int i_79_ = Class39_Sub5_Sub11.inputStream.readShortA(-1);
				Class39_Sub5_Sub8.method594(-99, i_79_);
				if (Class39_Sub5_Sub4_Sub5.openSidebarInterface != -1) {
					Class62_Sub2.method1084((byte) 117, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
					Class39_Sub14.aBoolean1520 = true;
					ISAAC.aBoolean1089 = true;
					Class39_Sub5_Sub4_Sub5.openSidebarInterface = -1;
				}
				if (Tile.anInt1912 != -1) {
					Class62_Sub2.method1084((byte) 115, Tile.anInt1912);
					Class14.aBoolean245 = true;
					Tile.anInt1912 = -1;
				}
				if (Class39_Sub5.anInt1348 != -1) {
					Class62_Sub2.method1084((byte) 100, Class39_Sub5.anInt1348);
					Class39_Sub5.anInt1348 = -1;
					Class39_Sub14.method879((byte) 40, 30);
				}
				if (Class39_Sub5_Sub2.anInt1713 != -1) {
					Class62_Sub2.method1084((byte) 123, Class39_Sub5_Sub2.anInt1713);
					Class39_Sub5_Sub2.anInt1713 = -1;
				}
				if (i_79_ != Class39_Sub11.openInterface) {
					Class62_Sub2.method1084((byte) 126, Class39_Sub11.openInterface);
					Class39_Sub11.openInterface = i_79_;
				} else
					Node.method410(Class39_Sub11.openInterface, true);
				Class39_Sub10.anInt1420 = -1;
				if (GameCharacter.anInt2285 != 0) {
					Class14.aBoolean245 = true;
					GameCharacter.anInt2285 = 0;
				}
				Class39_Sub4.method457(65, Class39_Sub11.openInterface);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 121) {
				Login.loadRegion(-519790717, false);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 238) {
				Class39_Sub14.method876(0);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 62) {
				int i_80_ = Class39_Sub5_Sub11.inputStream.readSignedByteC();
				int i_81_ = Class39_Sub5_Sub11.inputStream.readShort(-13);
				Class39_Sub5_Sub4_Sub2.anIntArray2225[i_81_] = i_80_;
				if (Class66.anIntArray1152[i_81_] != i_80_) {
					Class66.anIntArray1152[i_81_] = i_80_;
					Node.method408(i_81_, 1);
					if (ISAAC.anInt1095 != -1)
						Class14.aBoolean245 = true;
					Class39_Sub14.aBoolean1520 = true;
				}
				Class4.packetID = -1;
				Class66.anInt1153 = Class2.anInt48;
				return true;
			}
			if (Class4.packetID == 242) {
				CollisionMap.aBoolean504 = false;
				for (int i_82_ = 0; i_82_ < 5; i_82_++)
					Class44.aBooleanArray837[i_82_] = false;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 230) {
				Class48.anInt907 = Class39_Sub5_Sub11.inputStream.readShortLEA((byte) 125);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 244) {
				Node.anInt736 = Class39_Sub5_Sub11.inputStream.readByteC((byte) -36);
				ISAAC.anInt1084 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				while (Class39_Sub5_Sub11.inputStream.currentOffset < Class40.packetSize) {
					Class4.packetID = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
					Class12.method185(2834);
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 130) {
				int i_83_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				JString class3 = Class39_Sub5_Sub11.inputStream.readString();
				int i_84_ = Class39_Sub5_Sub11.inputStream.readByteA((byte) 30);
				if (i_83_ >= 1 && i_83_ <= 5) {
					if (class3.equalsIgnoreCase(Class36.aClass3_633))
						class3 = null;
					Class39_Sub14.aClass3Array1519[i_83_ - 1] = class3;
					RuntimeException_Sub1.aBooleanArray1225[i_83_ - 1] = i_84_ == 0;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 232) {
				int i_85_ = Class39_Sub5_Sub11.inputStream.readSignedShort(true);
				int i_86_ = Class39_Sub5_Sub11.inputStream.readSignedShort();
				int i_87_ = Class39_Sub5_Sub11.inputStream.readInt2();
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 70, i_87_);
				Class4.packetID = -1;
				class39_sub5_sub17.mainY = class39_sub5_sub17.anInt2024 + i_85_;
				class39_sub5_sub17.mainX = class39_sub5_sub17.anInt2090 + i_86_;
				return true;
			}
			if (Class4.packetID == 199) {
				int i_88_ = Class39_Sub5_Sub11.inputStream.readByteS();
				int i_89_ = Class39_Sub5_Sub11.inputStream.readByteC((byte) -63);
				int i_90_ = Class39_Sub5_Sub11.inputStream.readByteC((byte) 100);
				Class11.currentPlane = i_90_ >> 1;
				Class7.aClass39_Sub5_Sub4_Sub4_Sub2_109.method508(i_89_, (i_90_ & 0x1) == 1, (byte) -119, i_88_);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 163) {
				for (int i_91_ = 0; ObjectDef.anInt1923 > i_91_; i_91_++) {
					Class39_Sub5_Sub16 class39_sub5_sub16 = Class62.method1056(i_91_, 87);
					if (class39_sub5_sub16 != null && class39_sub5_sub16.anInt1978 == 0) {
						Class39_Sub5_Sub4_Sub2.anIntArray2225[i_91_] = 0;
						Class66.anIntArray1152[i_91_] = 0;
					}
				}
				Class39_Sub14.aBoolean1520 = true;
				if (ISAAC.anInt1095 != -1)
					Class14.aBoolean245 = true;
				Class66.anInt1153 = Class2.anInt48;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 117) {
				Class39_Sub7.anInt1380 = (Class39_Sub5_Sub11.inputStream.readShortA(-1) * 30);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 96) {
				Class42.anInt787 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				if (Class42.anInt787 == 1)
					Class30.anInt542 = Class39_Sub5_Sub11.inputStream.readShort(124);
				if (Class42.anInt787 >= 2 && Class42.anInt787 <= 6) {
					if (Class42.anInt787 == 2) {
						Class43.anInt823 = 64;
						Class39_Sub5_Sub18.anInt2124 = 64;
					}
					if (Class42.anInt787 == 3) {
						Class39_Sub5_Sub18.anInt2124 = 64;
						Class43.anInt823 = 0;
					}
					if (Class42.anInt787 == 4) {
						Class39_Sub5_Sub18.anInt2124 = 64;
						Class43.anInt823 = 128;
					}
					if (Class42.anInt787 == 5) {
						Class39_Sub5_Sub18.anInt2124 = 0;
						Class43.anInt823 = 64;
					}
					if (Class42.anInt787 == 6) {
						Class39_Sub5_Sub18.anInt2124 = 128;
						Class43.anInt823 = 64;
					}
					Class42.anInt787 = 2;
					JString.anInt1229 = Class39_Sub5_Sub11.inputStream.readShort(97);
					Login.anInt471 = Class39_Sub5_Sub11.inputStream.readShort(-35);
					Class66.anInt1158 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				}
				if (Class42.anInt787 == 10)
					Class34.anInt607 = Class39_Sub5_Sub11.inputStream.readShort(107);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 6) {
				int i_92_ = Class39_Sub5_Sub11.inputStream.readSignedShortLE((byte) -76);
				if (ISAAC.anInt1095 != i_92_) {
					Class62_Sub2.method1084((byte) -61, ISAAC.anInt1095);
					ISAAC.anInt1095 = i_92_;
				}
				Class14.aBoolean245 = true;
				Class39_Sub4.method457(103, ISAAC.anInt1095);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 90) {
				int i_93_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				int i_94_ = Class39_Sub5_Sub11.inputStream.readShortA(-1);
				if (i_94_ == 65535)
					i_94_ = -1;
				if (Tile.anIntArray1914[i_93_] == i_94_)
					Node.method410(Tile.anIntArray1914[i_93_], true);
				else {
					Class62_Sub2.method1084((byte) 109, (Tile.anIntArray1914[i_93_]));
					Tile.anIntArray1914[i_93_] = i_94_;
				}
				ISAAC.aBoolean1089 = true;
				Class39_Sub14.aBoolean1520 = true;
				Class39_Sub4.method457(115, Tile.anIntArray1914[i_93_]);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 15) {
				Class30.anInt544 = 0;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 245) {
				int i_95_ = Class39_Sub5_Sub11.inputStream.readInt2();
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 122, i_95_);
				for (int i_96_ = 0; i_96_ < class39_sub5_sub17.anIntArray2087.length; i_96_++) {
					class39_sub5_sub17.anIntArray2087[i_96_] = -1;
					class39_sub5_sub17.anIntArray2087[i_96_] = 0;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 10) {
				Node.anInt728 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class39_Sub14.aBoolean1520 = true;
				ISAAC.aBoolean1089 = true;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 180) {
				int i_97_ = Class39_Sub5_Sub11.inputStream.readIntLE();
				JString class3 = Class39_Sub5_Sub11.inputStream.readString();
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 112, i_97_);
				class39_sub5_sub17.text = class3;
				if (i_97_ >> 16 == Tile.anIntArray1914[Node.anInt728])
					Class39_Sub14.aBoolean1520 = true;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 234) {
				boolean bool = (Class39_Sub5_Sub11.inputStream.readByteA((byte) -101) == 1);
				int i_98_ = Class39_Sub5_Sub11.inputStream.readInt2();
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 84, i_98_);
				Class4.packetID = -1;
				class39_sub5_sub17.aBoolean2055 = bool;
				return true;
			}
			if (Class4.packetID == 25) {
				long l = Class39_Sub5_Sub11.inputStream.readLong();
				long l_99_ = (long) Class39_Sub5_Sub11.inputStream.readShort(126);
				long l_100_ = (long) Class39_Sub5_Sub11.inputStream.read3Bytes((byte) -62);
				int i_101_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				long l_102_ = (l_99_ << 32) - -l_100_;
				boolean bool = false;
				for (int i_103_ = 0; i_103_ < 100; i_103_++) {
					if (Class39_Sub7.aLongArray1385[i_103_] == l_102_) {
						bool = true;
						break;
					}
				}
				if (i_101_ <= 1) {
					for (int i_104_ = 0; Class15.anInt282 > i_104_; i_104_++) {
						if (l == Class39_Sub5_Sub9.aLongArray1808[i_104_]) {
							bool = true;
							break;
						}
					}
				}
				if (!bool && Class36.anInt630 == 0) {
					Class39_Sub7.aLongArray1385[Class46.anInt884] = l_102_;
					Class46.anInt884 = (Class46.anInt884 + 1) % 100;
					JString class3 = Class63.method1090(32767, Class39_Sub5_Sub11.inputStream).formatCapitalization(true);
					if (i_101_ != 2 && i_101_ != 3) {
						if (i_101_ != 1)
							Class42.pushMessage(Deque.longToString(l, (byte) 93).capitalizeAfterQuestion((byte) -73), class3, false, 3);
						else
							Class42.pushMessage((Class39_Sub5_Sub11.method708(new JString[] { Class37.aClass3_661, Deque.longToString(l, (byte) 108).capitalizeAfterQuestion((byte) -48) }, 14569)), class3, false, 7);
					} else
						Class42.pushMessage((Class39_Sub5_Sub11.method708((new JString[] { Class53.aClass3_959, Deque.longToString(l, (byte) 102).capitalizeAfterQuestion((byte) -116) }), 14569)), class3, false, 7);
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 97) {
				int i_105_ = Class39_Sub5_Sub11.inputStream.readShortLEA((byte) 126);
				Class39_Sub5_Sub8.method594(-90, i_105_);
				if (Class39_Sub5_Sub4_Sub5.openSidebarInterface != -1) {
					Class62_Sub2.method1084((byte) 114, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
					Class39_Sub5_Sub4_Sub5.openSidebarInterface = -1;
					Class39_Sub14.aBoolean1520 = true;
					ISAAC.aBoolean1089 = true;
				}
				if (Class39_Sub5.anInt1348 != -1) {
					Class62_Sub2.method1084((byte) -113, Class39_Sub5.anInt1348);
					Class39_Sub5.anInt1348 = -1;
					Class39_Sub14.method879((byte) 40, 30);
				}
				if (Class39_Sub5_Sub2.anInt1713 != -1) {
					Class62_Sub2.method1084((byte) -75, Class39_Sub5_Sub2.anInt1713);
					Class39_Sub5_Sub2.anInt1713 = -1;
				}
				if (Class39_Sub11.openInterface != -1) {
					Class62_Sub2.method1084((byte) 107, Class39_Sub11.openInterface);
					Class39_Sub11.openInterface = -1;
				}
				if (i_105_ != Tile.anInt1912) {
					Class62_Sub2.method1084((byte) 122, Tile.anInt1912);
					Tile.anInt1912 = i_105_;
				} else
					Node.method410(Tile.anInt1912, true);
				Class39_Sub10.anInt1420 = -1;
				Class39_Sub4.method457(45, Tile.anInt1912);
				Class14.aBoolean245 = true;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 213) {
				Class39_Sub14.aBoolean1520 = true;
				int i_106_ = Class39_Sub5_Sub11.inputStream.readInt();
				int i_107_ = Class39_Sub5_Sub11.inputStream.readShort(119);
				RSInterface class39_sub5_sub17;
				if (i_106_ < 0)
					class39_sub5_sub17 = null;
				else
					class39_sub5_sub17 = Class37.getInterface((byte) 14, i_106_);
				while (Class39_Sub5_Sub11.inputStream.currentOffset < Class40.packetSize) {
					int i_108_ = Class39_Sub5_Sub11.inputStream.readByteOrShort();
					int i_109_ = Class39_Sub5_Sub11.inputStream.readShort(93);
					int i_110_ = 0;
					if (i_109_ != 0) {
						i_110_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
						if (i_110_ == 255)
							i_110_ = Class39_Sub5_Sub11.inputStream.readInt();
					}
					if (class39_sub5_sub17 != null && i_108_ >= 0 && class39_sub5_sub17.anIntArray2087.length > i_108_) {
						class39_sub5_sub17.anIntArray2087[i_108_] = i_109_;
						class39_sub5_sub17.anIntArray2073[i_108_] = i_110_;
					}
					Class40.method889(i_108_, i_107_, i_109_ - 1, 28, i_110_);
				}
				Stream.anInt1364 = Class2.anInt48;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 82) {
				Node.anInt736 = Class39_Sub5_Sub11.inputStream.readByteS();
				ISAAC.anInt1084 = Class39_Sub5_Sub11.inputStream.readByteS();
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 95) {
				int i_111_ = Class39_Sub5_Sub11.inputStream.readIntLE();
				int i_112_ = Class39_Sub5_Sub11.inputStream.readSignedShortLEA(-1);
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 39, i_111_);
				if (i_112_ != class39_sub5_sub17.anInt2103 || i_112_ == -1) {
					class39_sub5_sub17.anInt2079 = 0;
					class39_sub5_sub17.anInt2103 = i_112_;
					class39_sub5_sub17.anInt1999 = 0;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 157) {
				JString class3 = Class39_Sub5_Sub11.inputStream.readString();
				if (!class3.endsWith(CacheArchive.aClass3_1293, 0)) {
					if (class3.endsWith(Class34.aClass3_614, 0)) {
						boolean bool = false;
						JString class3_113_ = (class3.substring(0, class3.indexOf((Class39_Sub5_Sub3.aClass3_1723))));
						long l = class3_113_.toInt64();
						for (int i_114_ = 0; i_114_ < Class15.anInt282; i_114_++) {
							if (Class39_Sub5_Sub9.aLongArray1808[i_114_] == l) {
								bool = true;
								break;
							}
						}
						if (!bool && Class36.anInt630 == 0)
							Class42.pushMessage(class3_113_, ISAAC.aClass3_1085, false, 8);
					} else if (!class3.endsWith(Class42.aClass3_792, 0))
						Class42.pushMessage(Class66.aClass3_1164, class3, false, 0);
					else {
						JString class3_115_ = (class3.substring(0, class3.indexOf((Class39_Sub5_Sub3.aClass3_1723))));
						long l = class3_115_.toInt64();
						boolean bool = false;
						for (int i_116_ = 0; Class15.anInt282 > i_116_; i_116_++) {
							if (l == Class39_Sub5_Sub9.aLongArray1808[i_116_]) {
								bool = true;
								break;
							}
						}
						if (!bool && Class36.anInt630 == 0) {
							JString class3_117_ = (class3.substring((class3.indexOf((Class39_Sub5_Sub3.aClass3_1723)) + 1), class3.length() - 9));
							Class42.pushMessage(class3_115_, class3_117_, false, 8);
						}
					}
				} else {
					JString class3_118_ = class3.substring(0, class3.indexOf((Class39_Sub5_Sub3.aClass3_1723)));
					long l = class3_118_.toInt64();
					boolean bool = false;
					for (int i_119_ = 0; Class15.anInt282 > i_119_; i_119_++) {
						if (l == Class39_Sub5_Sub9.aLongArray1808[i_119_]) {
							bool = true;
							break;
						}
					}
					if (!bool && Class36.anInt630 == 0)
						Class42.pushMessage(class3_118_, Class30.aClass3_535, false, 4);
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 193) {
				Login.loadRegion(-519790717, true);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 24) {
				int i_120_ = Class39_Sub5_Sub11.inputStream.readShortLE(10670);
				int i_121_ = Class39_Sub5_Sub11.inputStream.readInt1();
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 115, i_121_);
				class39_sub5_sub17.anInt2026 = i_120_;
				class39_sub5_sub17.anInt2009 = 1;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 241) {
				CollisionMap.aBoolean504 = true;
				Class53.anInt965 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class39_Sub5_Sub18.anInt2121 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class24.anInt454 = Class39_Sub5_Sub11.inputStream.readShort(96);
				PacketStream.anInt2156 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class32.anInt590 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				if (Class32.anInt590 >= 100) {
					int i_122_ = Class53.anInt965 * 128 + 64;
					int i_123_ = Class39_Sub5_Sub18.anInt2121 * 128 + 64;
					int i_124_ = (Class14.method212(i_123_, 9990, Class11.currentPlane, i_122_) - Class24.anInt454);
					int i_125_ = i_122_ - Class39_Sub11.anInt1470;
					int i_126_ = -Class39_Sub10.anInt1437 + i_124_;
					int i_127_ = i_123_ - Node.anInt742;
					int i_128_ = (int) Math.sqrt((double) (i_125_ * i_125_ + i_127_ * i_127_));
					Class43.anInt799 = (int) (Math.atan2((double) i_126_, (double) i_128_) * 325.949) & 0x7ff;
					GameCharacter.anInt2315 = (int) (Math.atan2((double) i_125_, (double) i_127_) * -325.949) & 0x7ff;
					if (Class43.anInt799 < 128)
						Class43.anInt799 = 128;
					if (Class43.anInt799 > 383)
						Class43.anInt799 = 383;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 91) {
				publicChatOptions = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class11.privateChatOptions = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class7.tradeCompeteOptions = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				GameCharacter.chatOptionsNeedRedraw = true;
				Class14.aBoolean245 = true;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 133) {
				ISAAC.anInt1084 = Class39_Sub5_Sub11.inputStream.readByteA((byte) 27);
				Node.anInt736 = Class39_Sub5_Sub11.inputStream.readByteS();
				for (int i_129_ = Node.anInt736; i_129_ < Node.anInt736 + 8; i_129_++) {
					for (int i_130_ = ISAAC.anInt1084; i_130_ < ISAAC.anInt1084 + 8; i_130_++) {
						if ((Class20.groundItems[Class11.currentPlane][i_129_][i_130_]) != null) {
							Class20.groundItems[Class11.currentPlane][i_129_][i_130_] = null;
							Class65.method1092(i_129_, i_130_, (byte) -127);
						}
					}
				}
				for (Class39_Sub11 class39_sub11 = ((Class39_Sub11) Class15.aClass49_278.method969(false)); class39_sub11 != null; class39_sub11 = ((Class39_Sub11) Class15.aClass49_278.method963((byte) -87))) {
					if (Node.anInt736 <= class39_sub11.anInt1466 && Node.anInt736 + 8 > class39_sub11.anInt1466 && ISAAC.anInt1084 <= class39_sub11.anInt1474 && class39_sub11.anInt1474 < ISAAC.anInt1084 + 8 && Class11.currentPlane == class39_sub11.anInt1458)
						class39_sub11.anInt1456 = 0;
				}
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 226) {
				if (Node.anInt728 == 12)
					Class39_Sub14.aBoolean1520 = true;
				Class39_Sub9.runEnergy = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 32) {
				if (Tile.anInt1912 != -1) {
					Class62_Sub2.method1084((byte) -40, Tile.anInt1912);
					Tile.anInt1912 = -1;
				}
				Class4.packetID = -1;
				Class14.aBoolean245 = true;
				GameCharacter.anInt2285 = 1;
				Class39_Sub12.aBoolean1489 = false;
				Class66.aClass3_1151 = Class66.aClass3_1164;
				return true;
			}
			if (Class4.packetID == 81) {
				int i_131_ = Class39_Sub5_Sub11.inputStream.readShort(-111);
				int i_132_ = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				int i_133_ = Class39_Sub5_Sub11.inputStream.readShort(-23);
				CollisionMap.method296(i_133_, i_132_, true, i_131_);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 236) {
				Class40.anInt756 = Class39_Sub5_Sub11.inputStream.readByte((byte) -8);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 178) {
				if (Class39_Sub5_Sub4_Sub5.openSidebarInterface != -1) {
					Class62_Sub2.method1084((byte) -34, Class39_Sub5_Sub4_Sub5.openSidebarInterface);
					ISAAC.aBoolean1089 = true;
					Class39_Sub14.aBoolean1520 = true;
					Class39_Sub5_Sub4_Sub5.openSidebarInterface = -1;
				}
				if (Tile.anInt1912 != -1) {
					Class62_Sub2.method1084((byte) -99, Tile.anInt1912);
					Class14.aBoolean245 = true;
					Tile.anInt1912 = -1;
				}
				if (Class39_Sub5.anInt1348 != -1) {
					Class62_Sub2.method1084((byte) -125, Class39_Sub5.anInt1348);
					Class39_Sub5.anInt1348 = -1;
					Class39_Sub14.method879((byte) 40, 30);
				}
				if (Class39_Sub5_Sub2.anInt1713 != -1) {
					Class62_Sub2.method1084((byte) 106, Class39_Sub5_Sub2.anInt1713);
					Class39_Sub5_Sub2.anInt1713 = -1;
				}
				if (Class39_Sub11.openInterface != -1) {
					Class62_Sub2.method1084((byte) -88, Class39_Sub11.openInterface);
					Class39_Sub11.openInterface = -1;
				}
				Class4.packetID = -1;
				Class39_Sub10.anInt1420 = -1;
				if (GameCharacter.anInt2285 != 0) {
					Class14.aBoolean245 = true;
					GameCharacter.anInt2285 = 0;
				}
				return true;
			}
			if (Class4.packetID == 22) {
				int i_134_ = Class39_Sub5_Sub11.inputStream.readShortLEA((byte) 121);
				if (i_134_ == 65535)
					i_134_ = -1;
				int i_135_ = Class39_Sub5_Sub11.inputStream.readInt2();
				int i_136_ = Class39_Sub5_Sub11.inputStream.readIntLE();
				RSInterface class39_sub5_sub17 = Class62_Sub2.method1081(i_136_, i_134_, 0);
				if (class39_sub5_sub17 != null)
					class39_sub5_sub17.anInt2049 = i_135_;
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 220) {
				for (int i_137_ = 0; Class66.anIntArray1152.length > i_137_; i_137_++) {
					if (Class39_Sub5_Sub4_Sub2.anIntArray2225[i_137_] != Class66.anIntArray1152[i_137_]) {
						Class66.anIntArray1152[i_137_] = Class39_Sub5_Sub4_Sub2.anIntArray2225[i_137_];
						Node.method408(i_137_, 1);
						Class39_Sub14.aBoolean1520 = true;
					}
				}
				Class4.packetID = -1;
				Class66.anInt1153 = Class2.anInt48;
				return true;
			}
			if (Class4.packetID == 227) {
				int i_138_ = Class39_Sub5_Sub11.inputStream.readShort(110);
				int i_139_ = Class39_Sub5_Sub11.inputStream.readInt();
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 74, i_139_);
				class39_sub5_sub17.anInt2026 = i_138_;
				Class4.packetID = -1;
				class39_sub5_sub17.anInt2009 = 2;
				return true;
			}
			if (Class4.packetID == 31) {
				int i_140_ = Class39_Sub5_Sub11.inputStream.readIntLE();
				RSInterface class39_sub5_sub17 = Class37.getInterface((byte) 87, i_140_);
				class39_sub5_sub17.anInt2009 = 3;
				class39_sub5_sub17.anInt2026 = Class7.aClass39_Sub5_Sub4_Sub4_Sub2_109.aClass45_2516.method928(102);
				Class4.packetID = -1;
				return true;
			}
			if (Class4.packetID == 51) {
				if (Tile.anInt1912 != -1) {
					Class62_Sub2.method1084((byte) -41, Tile.anInt1912);
					Tile.anInt1912 = -1;
				}
				Class4.packetID = -1;
				GameCharacter.anInt2285 = 2;
				Class39_Sub12.aBoolean1489 = false;
				Class66.aClass3_1151 = Class66.aClass3_1164;
				Class14.aBoolean245 = true;
				return true;
			}
			Class39_Sub7.method849(null, 64, ("T1 - " + Class4.packetID + "," + CacheArchive.anInt1283 + "," + Class24.anInt448 + " - " + Class40.packetSize));
			ISAAC.method1044(7641);
		} catch (java.io.IOException ioexception) {
			Class37.method354((byte) 39);
		} catch (Exception exception) {
			String string = ("T2 - " + Class4.packetID + "," + CacheArchive.anInt1283 + "," + Class24.anInt448 + " - " + Class40.packetSize + "," + (Class7.aClass39_Sub5_Sub4_Sub4_Sub2_109.anIntArray2314[0] + Class65.absoluteRegionX) + "," + (Class35.absoluteRegionY + (Class7.aClass39_Sub5_Sub4_Sub4_Sub2_109.anIntArray2255[0])) + " - ");
			for (int i_141_ = 0; i_141_ < Class40.packetSize && i_141_ < 50; i_141_++)
				string += (Class39_Sub5_Sub11.inputStream.buffer[i_141_]) + ",";
			Class39_Sub7.method849(exception, 64, string);
			ISAAC.method1044(7641);
		}
		return true;
	}

	static {
		aClass3_1049 = aClass3_1058;
		aClass3_1050 = aClass3_1041;
		mouseY = 0;
		publicChatOptions = 0;
		aClass3_1074 = Class39_Sub5_Sub9.createJString(120, "Willkommen auf RuneScape");
		aClass3_1056 = Class39_Sub5_Sub9.createJString(115, "backbase1");
	}
}
